import request from '@/utils/request'

// 获得申请信息
export function getApplication(data) {
  return request({
    url: '/application/selectAll',
    method: 'post',
    data

  })
}

// 更新申请状态
export function upadteApplication(data) {
  return request({
    url: '/application/updateOne',
    method: 'post',
    data
  })
}

// 展示病人信息
export function showPatientInfo(id) {
  return request({
    url: '/patient/selectOne?id=' + id,
    method: 'get'
  })
}

// 通过患者手机号查询患者信息
export function getPatientInfoByTellphone(tellPhone) {
  return request({
    url: '/patient/getByPhone?tellPhone=' + tellPhone,
    method: 'get'
  })
}

// 查询患者病历信息
export function showPatientRecord(patientId) {
  return request({
    url: '/record/selectOneByPatientId?patientId=' + patientId,
    method: 'get'
  })
}

// 查询当前登陆用户所在科室病
export function getCurrentUserDep() {
  return request({
    url: '/department/getCurrentUserDep',
    method: 'get'
  })
}

// 获得预约申请信息通过病人id
export function getApplicationByPatientId(data) {
  return request({
    url: '/application/selectOneByPatientId?patientId=' + data,
    method: 'get'
  })
}

// 通过医生id查询医生姓名
export function getDoctorNameByDoctorId(data) {
  return request({
    url: '/hisUser/selectOne?id=' + data,
    method: 'get'
  })
}

// 更新病人病历通过病人id
export function updateRecordById(data) {
  return request({
    url: '/record/updateOne',
    method: 'post',
    data
  })
}

// 添加一条申请
export function insertOne(data) {
  return request({
    url: '/application/insertOne',
    method: 'post',
    data
  })
}

// 病人查询记录
export function getByPatientId() {
  return request({
    url: '/application/getByPatientId',
    method: 'get'
  })
}

// 后台人员添加住院记录
export function insertByTemp(data) {
  return request({
    url: '/application/insertByTemp',
    method: 'post',
    data
  })
}

// 获取vo三表实体对象
export function getAllApplicantInfoByAdvice(data) {
  return request({
    url: '/application/getAllApplicantInfoByAdvice',
    method: 'post',
    data
  })
}

// 获取vo三表实体对象
export function getAllApplyPatientInfo(data) {
  return request({
    url: '/application/getApplicantInfo',
    method: 'post',
    data
  })
}
// 根据住院编号查询住院记录
export function getByNo(data) {
  return request({
    url: '/application/getByNo?no=' + data,
    method: 'get'
  })
}

